package Lambda表达式;

import java.util.Arrays;
import java.util.Comparator;

public class test {
    public static void main(String[] args) {
        Integer []arr={1,2,3,4,5,6,7,8,9,10};
        /*Arrays.sort(arr, new Comparator<Integer>() {
            @Override
            public int compare(Integer o1, Integer o2) {
                return o2-o1;
            }
        });*/
        Arrays.sort(arr, (Integer o1, Integer o2) -> {
                return o2-o1;
        });

        System.out.println(Arrays.toString(arr));

        for (Integer i : arr) {

        }
    }
}
